﻿using System;
using CoreRay;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace CoreRay.Testing
{
    //-----------------------------------------------------------------------------------------
    /// <summary>
    /// This is a test class for RenderRegionTest and is intended to contain all 
    /// RenderRegionTest Unit Tests.
    /// </summary>
    //-----------------------------------------------------------------------------------------
    [TestClass]
    public class RenderRegionTest
    {
        //-----------------------------------------------------------------------------------------
        /// <summary>
        /// A test for RenderRegion Constructor.
        /// </summary>
        //-----------------------------------------------------------------------------------------
        [TestMethod]
        public void RenderRegionConstructorTest()
        {
            int positionX = 15;
            int positionY = 98;
            int width = 650;
            int height = 258;
            
            RenderRegion target = new RenderRegion(positionX, positionY, width, height);

            Assert.IsTrue(target.PositionX == positionX && target.PositionY == positionY && target.Width == width && target.Height == height);
        }


        //-----------------------------------------------------------------------------------------
        /// <summary>
        /// A test for RenderRegion Constructor with negative positionX.
        /// </summary>
        //-----------------------------------------------------------------------------------------
        [TestMethod]
        [ExpectedException(typeof(ArgumentException))]
        public void RenderRegionConstructorNegativePositionXTest()
        {
            int positionX = -15;
            int positionY = 98;
            int width = 650;
            int height = 258;

            RenderRegion target = new RenderRegion(positionX, positionY, width, height);
        }


        //-----------------------------------------------------------------------------------------
        /// <summary>
        /// A test for RenderRegion Constructor with negative positionY.
        /// </summary>
        //-----------------------------------------------------------------------------------------
        [TestMethod]
        [ExpectedException(typeof(ArgumentException))]
        public void RenderRegionConstructorNegativePositionYTest()
        {
            int positionX = 15;
            int positionY = -98;
            int width = 650;
            int height = 258;

            RenderRegion target = new RenderRegion(positionX, positionY, width, height);
        }


        //-----------------------------------------------------------------------------------------
        /// <summary>
        /// A test for RenderRegion Constructor with negative width.
        /// </summary>
        //-----------------------------------------------------------------------------------------
        [TestMethod]
        [ExpectedException(typeof(ArgumentException))]
        public void RenderRegionConstructorNegativeWidthTest()
        {
            int positionX = 15;
            int positionY = 98;
            int width = -650;
            int height = 258;

            RenderRegion target = new RenderRegion(positionX, positionY, width, height);
        }


        //-----------------------------------------------------------------------------------------
        /// <summary>
        /// A test for RenderRegion Constructor with negative height.
        /// </summary>
        //-----------------------------------------------------------------------------------------
        [TestMethod]
        [ExpectedException(typeof(ArgumentException))]
        public void RenderRegionConstructorNegativeHeightTest()
        {
            int positionX = 15;
            int positionY = 98;
            int width = 650;
            int height = -258;

            RenderRegion target = new RenderRegion(positionX, positionY, width, height);
        }
    }
}
